<tr>
<td colspan="6" style="height: 104px">
<img src="images/header.png"></td>
</tr>
</table>
<table style="width: 810px" background="images/menu.png" cellspacing="0" cellpadding="0" border="0">
<tr >
<td style="width: 11px; height: 40px">
&nbsp;</td>
<td style="width: 84px; height: 40px" border="0">
<a href="home.php"><img src="images/homeS.png" border='0' onmouseover='this.src="images/homeO.png"' onmouseout='this.src="images/homeS.png"'></a></td>
<td style="width: 84px; height: 40px">
<a href="vote.php"><img src="images/voteS.png" border='0' onmouseover='this.src="images/voteO.png"' onmouseout='this.src="images/voteS.png"'></a></td>
<td style="width: 84px; height: 40px">
<a href="candidates.php"><img src="images/candidateS.png" border='0' onmouseover='this.src="images/candidateO.png"' onmouseout='this.src="images/candidateS.png"'></a></td>
<td style="width: 84px; height: 40px">
<?php //Admin button will show for admins, Result button for voters
	//Connect to database first
	mysql_connect($server,$user,$pass) or die(mysql_error());
	mysql_select_db($db) or die(mysql_error());
	$checkPermission = mysql_query("SELECT voter_permission from voters where voter_num = '".$userNum."'");
		while($row = mysql_fetch_array($checkPermission)){
		$permission = $row['voter_permission']; //Get the permission of user
		}
	if($permission == 'Admin'){ //If the user is an Administrator
	     ?><a href='admin.php'><img src='images/adminS.png' border='0' onmouseover='this.src="images/adminO.png"' onmouseout='this.src="images/adminS.png"'></a><?php	
	}elseif($permission == 'Voter'){ // If the user is a Voter
	    ?><a href='results.php'><img src='images/resultS.png' border='0' onmouseover='this.src="images/resultO.png"' onmouseout='this.src="images/resultS.png"'></a><?php
	}else{
        //Do nothing - no button will be shown
	}
?>
</td>
<td style="width: 447px; height: 40px">
</td>
<td style="width: 84px; height: 40px">

<a href='logout.php'><img src='images/logoutS.png' border='0' onmouseover='this.src="images/logoutO.png"' onmouseout='this.src="images/logoutS.png"'></a></td>

</tr>